package com.sys.SysWaterQuality.service.impl;

import java.util.List;
import com.sys.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sys.SysWaterQuality.mapper.SysWaterQualityInspectionMapper;
import com.sys.SysWaterQuality.domain.SysWaterQualityInspection;
import com.sys.SysWaterQuality.service.ISysWaterQualityInspectionService;

/**
 * 水质巡查记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-19
 */
@Service
public class SysWaterQualityInspectionServiceImpl implements ISysWaterQualityInspectionService
{
    @Autowired
    private SysWaterQualityInspectionMapper sysWaterQualityInspectionMapper;

    /**
     * 查询水质巡查记录
     * 
     * @param id 水质巡查记录主键
     * @return 水质巡查记录
     */
    @Override
    public SysWaterQualityInspection selectSysWaterQualityInspectionById(Long id)
    {
        return sysWaterQualityInspectionMapper.selectSysWaterQualityInspectionById(id);
    }

    /**
     * 查询水质巡查记录列表
     * 
     * @param sysWaterQualityInspection 水质巡查记录
     * @return 水质巡查记录
     */
    @Override
    public List<SysWaterQualityInspection> selectSysWaterQualityInspectionList(SysWaterQualityInspection sysWaterQualityInspection)
    {
        return sysWaterQualityInspectionMapper.selectSysWaterQualityInspectionList(sysWaterQualityInspection);
    }

    /**
     * 新增水质巡查记录
     * 
     * @param sysWaterQualityInspection 水质巡查记录
     * @return 结果
     */
    @Override
    public int insertSysWaterQualityInspection(SysWaterQualityInspection sysWaterQualityInspection)
    {
        sysWaterQualityInspection.setCreateBy(sysWaterQualityInspection.getCreateBy());
        sysWaterQualityInspection.setUpdateBy(sysWaterQualityInspection.getUpdateBy());
        sysWaterQualityInspection.setUpdateTime(DateUtils.getNowDate());
        sysWaterQualityInspection.setCreateTime(DateUtils.getNowDate());
        return sysWaterQualityInspectionMapper.insertSysWaterQualityInspection(sysWaterQualityInspection);
    }

    /**
     * 修改水质巡查记录
     * 
     * @param sysWaterQualityInspection 水质巡查记录
     * @return 结果
     */
    @Override
    public int updateSysWaterQualityInspection(SysWaterQualityInspection sysWaterQualityInspection)
    {
        sysWaterQualityInspection.setUpdateBy(sysWaterQualityInspection.getUpdateBy());
        sysWaterQualityInspection.setUpdateTime(DateUtils.getNowDate());
        return sysWaterQualityInspectionMapper.updateSysWaterQualityInspection(sysWaterQualityInspection);
    }

    /**
     * 批量删除水质巡查记录
     * 
     * @param ids 需要删除的水质巡查记录主键
     * @return 结果
     */
    @Override
    public int deleteSysWaterQualityInspectionByIds(Long[] ids)
    {
        return sysWaterQualityInspectionMapper.deleteSysWaterQualityInspectionByIds(ids);
    }

    /**
     * 删除水质巡查记录信息
     * 
     * @param id 水质巡查记录主键
     * @return 结果
     */
    @Override
    public int deleteSysWaterQualityInspectionById(Long id)
    {
        return sysWaterQualityInspectionMapper.deleteSysWaterQualityInspectionById(id);
    }
}
